package com.zzyl.controller.Iot;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.service.DeviceDataService;
import com.zzyl.vo.DeviceDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description DeviceDataController
 * @Author huangdongye
 * @Date 2025-05-22  16:53
 */
@RestController
@RequestMapping("/device-data")
public class DeviceDataController extends BaseController {
    @Autowired
    private DeviceDataService deviceDataService;
    /**
     * 分页查询设备数据
     * @param deviceDataPageReqDto
     * @return
     */
    @GetMapping("/get-page")
    public ResponseResult<DeviceDataVo> pageDeviceData(DeviceDataPageReqDto deviceDataPageReqDto){
        PageResponse<DeviceDataVo> page = deviceDataService.page(deviceDataPageReqDto);
        return success(page);
    }
}
